using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace RegionHost
{
    class Program
    {
        static void Main(string[] args)
        {
            RegionCore.ServerMessage thread = new RegionCore.ServerMessage();
            thread.Start(args);
            string notes = " input 'al' to show avatars list; \n input 'cp' to clear avatars list;\n input 'cs' to clear screem;\n input 'rd' to show receive data numbers;\n input 'sd' to show send data number each player;\n input 'sl x' to show log level(x is level);\n input 'exit' to exit!";
            Console.WriteLine(notes);
        Labe:
            string input = Console.ReadLine();
            switch (input)
            {  
                case "exit":
                    {
                        thread.Stop();
                        break;
                    }
                case "al":
                    {
                        thread.ShowPlayerList();
                        goto Labe;
                    }
                case "cp":
                    {
                        thread.Clear();
                        goto Labe;
                    }
                case "cs":
                    {
                        Console.Clear();
                        goto Labe;
                    }
                default:
                    {
                        if (input.IndexOf("sl") > -1)
                        {
                            int.TryParse(input.Replace("sl", ""), out Log.ShowLog);
                            goto Labe;
                        }
                        Console.WriteLine(notes);
                        goto Labe;
                    }
            }
        }
    }
}
